package com.lzc.mis.pos.service.impl;

import com.lzc.mis.pos.entity.PosCategory;
import com.lzc.mis.pos.mapper.CategoryMapper;
import com.lzc.mis.pos.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author <l_haha@outlook.com>
 * @version 1.0.0
 * @ClassName com.lzc.mis.pos.service.impl.CategoryServiceImpl.java
 * @createTime 2021 09 23
 * @Description TODO
 */
@Service
public class CategoryServiceImpl implements ICategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public PosCategory queryById(Integer categoryId) {
        return this.categoryMapper.queryById(categoryId);
    }

    @Override
    public List<PosCategory> queryAll(PosCategory posCategory) {
        return this.categoryMapper.queryAll(posCategory);
    }

    @Override
    public void insert(PosCategory posCategory) {
        this.categoryMapper.insert(posCategory);
    }

    @Override
    public void update(PosCategory posCategory) {
        this.categoryMapper.update(posCategory);
    }

    @Override
    public boolean deleteById(Integer categoryID) {
        return this.categoryMapper.deleteById(categoryID) > 0;
    }
}
